1. Field of the Invention
The present invention relates to the design of computer systems that support objects defined within an object-oriented programming system. More specifically, the present invention relates to a method and an apparatus for relocating objects within an object-addressed memory hierarchy in a computer system that supports concurrent execution.
2. Related Art
Objects defined within an object-oriented programming system are frequently relocated within memory for purposes of garbage collection or compaction. This relocation process is relatively straightforward in a uniprocessor system in which only a single processor can modify memory at a given time. However, this process is significantly more complicated in systems that support concurrent execution.
In such systems, it is possible for processors to interfere with each other during the relocation process. For example, it is possible for different processors to update pointers to the object in an inconsistent manner. However, this is not a problem in a computer system that supports an object-addressed memory hierarchy, wherein objects are addressed through object identifiers that are translated into corresponding physical addresses for the objects. This translation process involves using an object identifier to look up an object table entry that contains a physical address for the object. Since the physical address for the object is located in only one place (the object table entry), it is not necessary to update multiple pointers to the object. Instead, updating the physical address in the object table entry will cause subsequent references to the object to use the new address.
Unfortunately, even in computer systems that provide an object-addressed memory hierarchy, processors can still interfere with each other during the object relocation process. For example, a first processor can possibly modify an object while the object is being relocated by a second processor. In this case, some of the modifications made by the first processor can possibly be lost if the modifications are made to an old version of the object, after the second processor has copied corresponding portions of the object to the new location.
Of course, it is possible to solve this problem by stopping all processing activity within the computer system while compaction and garbage collection operations take place. However, doing so greatly decreases computer system performance.
Hence, what is needed is a method and an apparatus for relocating objects within a computer system that supports concurrent execution without the above-described problems.